home *** CD-ROM | disk | FTP | other *** search
/ Gamers Delight 2 / Gamers Delight 2.iso / Aminet / game / role / AMScen_0_9.lha / AMScen / Extras / hex.m < prev    next >
Text File  |  1995-01-21  |  370b  |  22 lines

  1. private proc IntToHex(int n)string:
  2.     string s;
  3.     int i;
  4.  
  5.     s := "0x";
  6.     for i from 0 upto 7 do
  7.     s := s + SubString("0123456789abcdef", n >> (28 - i * 4) & 0xf, 1);
  8.     od;
  9.     s
  10. corp;
  11.  
  12. private proc IntToBin(int n)string:
  13.     string s;
  14.     int i;
  15.  
  16.     s := "0b";
  17.     for i from 0 upto 31 do
  18.     s := s + SubString("01", n >> (31 - i) & 0b1, 1);
  19.     od;
  20.     s
  21. corp;
  22.